var n=0;
var showNum = document.getElementById("num");
function Mea(value){
	n=value;
	//setBg(value);
	setjt(value);
	plays(value);
	
	}
function setBg(value){
	for(var i=0;i<4;i++)
   if(value==i){
		showNum.getElementsByTagName("img")[i].className='';
		} 
	else{	
		showNum.getElementsByTagName("img")[i].className='';
		}  
	} 
	
	function setjt(value){

	for(var i=0;i<4;i++)
   if(value==i){
		showNum.getElementsByTagName("li")[i].className='nos';
		} 
	else{	
		showNum.getElementsByTagName("li")[i].className='s';
		}  
	} 
function plays(value){
	try
	{
		with (fc)
		{
			filters[0].Apply();
			for(i=0;i<4;i++)i==value?children[i].className='a':children[i].className='b'; 
			filters[0].play(); 
		}
		with (con)
		{
			filters[0].Apply();
			for(i=0;i<4;i++)i==value?children[i].className='a':children[i].className='b';
			filters[0].play(); 
		}
	}
	catch(e)
	{
		var divlist = document.getElementById("fc").getElementsByTagName("div");
		var textlist = document.getElementById("con").getElementsByTagName("div");
		for(i=0;i<4;i++)
		{
			i==value?divlist[i].style.display="block":divlist[i].style.display="none";
			i==value?textlist[i].style.display="block":textlist[i].style.display="none";
		}
	}

	
}


function clearAuto(){clearInterval(autoStart)}
function setAuto(){autoStart=setInterval("sup(n)", 3000)}
function sup(){
	n++;
	if(n>3)n=0;
	Mea(n);
} 
function sub(){
	n--;
	if(n<0)n=3;
	Mea(n);
} 
setAuto(); 